<?php
$arguments['title'] = "料车";
$arguments['location'] = array(
    "首页",
    "功能单元",
    "料车",
);
$arguments['css'] = array(
    PUBLIC_LIB.'js/core/Pagination/kkpager_orange.css',
    PUBLIC_LIB.'fonts/hui_iconfont/iconfont.css',
    PUBLIC_LIB.'css/biz/enhanced.css',
    PUBLIC_LIB.'js/core/Dropdownlist/chosen.css',
    PUBLIC_LIB.'js/jquery/jquery-ui-1.11.4.custom/jquery-ui.css',
    PUBLIC_LIB.'js/core/fancybox/jquery.fancybox-1.3.4.css',
);
$arguments['js'] = array(
    PUBLIC_LIB.'js/core/fancybox/jquery-1.7.1.js',
    PUBLIC_LIB.'js/core/Pagination/kkpager.min.js',
    PUBLIC_LIB.'js/core/DatePicker/WdatePicker.js',
    PUBLIC_LIB.'js/biz/custominput.js', 
    PUBLIC_LIB.'js/core/Dropdownlist/chosen.jquery.js',  
    PUBLIC_LIB.'js/biz/pagelist.js',
    PUBLIC_LIB.'js/core/Tooltip/tooltip.js',
    PUBLIC_LIB.'js/jquery/jquery-ui-1.11.4.custom/jquery-ui.js',
    PUBLIC_LIB.'js/ajaxupload/ajaxfileupload.js',
    PUBLIC_LIB.'js/biz/ajaxfun.js',
    PUBLIC_LIB.'js/core/fancybox/jquery.fancybox-1.3.4.js',
    PUBLIC_LIB.'js/core/fancybox/jquery.fancybox-1.3.4.pack.js',
    PUBLIC_LIB.'js/biz/skipList.js',     
);
importHeader($arguments);
?>
<div class="formtitle"><span>料车</span></div>
    <div class="search">
     <FORM id="form" method="post">
        <p>
            <div class="label_title">
                <label for="car_num">料车编号：</label>
            </div>
            <div class="search_text">
                <input  type="text" class="dfinput search_width" id="car_num" name="car_num" value=""/>
            </div>
            <div class="label_title">
                    <label for="agv_type">AGV型号：</label>
                </div>
                <div class="search_text">
                    <select class="dfinput search_width" id="agv_type" name="agv_type">
                            <option value="">全部</option>
                            <option value="">xx009</option>
                            <option value="">ccc008</option>
                            <option value="">scd09879</option>
                    </select>
                </div> 
            <div style="margin-left:300px;">
                <button type="button" class="tool tool_left" id="search"><i class="Hui-iconfont">&#xe683;</i>查询</button>   
                <div class="tool  tool_btn" id="addskipcar"><i class="Hui-iconfont">&#xe600;</i>新增</div>
            </div>
        </p>
            <div class="label_title">
                <label for="goods_status">货物状态：</label>
            </div>
            <div class="search_text">
                <select class="dfinput search_width" id="goods_status" name="goods_status">
                        <option value="">全部</option>
                        <option value="">空载</option>
                        <option value="">满载</option>
                </select>
            </div> 
            <div class="label_title">
                <label for="work_status">工作状态：</label>
            </div>
            <div class="search_text">
                <select class="dfinput search_width" id="work_status" name="work_status">
                    <option value="">全部</option>
                    <option value="">装载中</option>
                    <option value="">卸载中</option>
                    <option value="">运行中</option>
                </select>
            </div> 
        </p>
        <p>
            <p>
            <div class="label_title">
                <label>是否故障：</label>
            </div>
            <div class="span_check">
                <input type="radio" name="state" id="state1"  value="1"/>
                <label for="state1" class="label_checkbox">全部</label>  
            </div>
            <div class="span_check">
                <input type="radio" name="state" id="state1"  value="1"/>
                <label for="state1" class="label_checkbox">是</label>  
            </div>
            <div class="span_check">
                <input type="radio" name="state" id="state2"  value="0"/>
                <label for="state1" class="label_checkbox">否</label>  
            </div>
            <div class="label_title" style="width: 110px;">
                <label for="date" class="label_checkbox">投入使用时间：</label>  
            </div>
            <div class="search_text">
                <input  type="text" class="dfinput search_width" id="date_start" name="date_start" onClick="WdatePicker()" value=""/>
            </div>  
            <div class="label_title">
                <label>至：</label>
            </div>
            <div class="search_text">
                <input  type="text" class="dfinput search_width" id="date_end" name="date_end" onClick="WdatePicker()" value=""/>
            </div>   
        </p>

       </FORM>     
    </div>
    <div class="table_box tablelist">
        <table width="100%">
            <tr>
                <th width="10%">料车编号</th>
                <th width="10%">AGV型号</th>
                <th width="10%">当前位置</th>
                <th width="15%">投入使用时间</th>
                <th width="10%">货物状态</th>
                <th width="10%">工作状态</th>
                <th width="10%">是否故障</th>
                <th width="25%">操作</th>
            </tr>
        </table>
        <table width="100%">
            <tr>
                <td width="10%">xxll0090</td>
                <td width="10%">ddsd4544</td>
                <td width="10%">100,200</td>
                <td width="15%">2015.3.3</td>
                <td width="10%">满载</td>
                <td width="10%">运行中</td>
                <td width="10%">否</td>
                <td width="25%">
                    <a href=""><div class="tools tool_left" id="detail"><i class="Hui-iconfont">&#xe695;</i>详情</div></a>
                    <a href=""><div class="tools tool_left" id="skipEdit"><i class="Hui-iconfont">&#xe60c;</i>编辑</div></a>
                    <a href="javascript:skipDelete();"><div class="tools tool_left"><i class="Hui-iconfont">&#xe609;</i>删除</div></a>
                </td>
            </tr>
            <?php
                if(isset($carList) && !empty($carList->list) && count($carList->list)>0){
                    foreach($carList->list as $car){
                        echo '<tr>
                            <td width="10%">',$car->vin,'</td>  
                            <td width="10%">',$car->state,'</td>  
                            <td width="10%">',$car->invoiceStatus==1?'已开票':'未开票','</td> 
                            <td width="5%">',$car->type,'</td> 
                            <td width="10%">',$car->ein,'</td> 
                            <td width="5%">',$car->color,'</td> 
                            <td width="5%">',$car->hubNum,'</td> 
                            <td width="10%">',$car->fuelType,'</td> 
                            <td width="5%">',$car->dpm,'</td>
                            <td width="5%">',$car->seatNum,'</td>    
                            <td width="30%">
                        <a href="#" onClick="lookDetail(\'',$car->vehicleId,'\');"><div class="tools tool_left"><i class="Hui-iconfont">&#xe695;</i>查看详情</div></a>
                    <a href="#" onClick="vehicleEdit(\'',$car->vehicleId,'\');"><div class="tools tool_left"><i class="Hui-iconfont">&#xe60c;</i>编辑</div></a>
                    <a href="#" onClick="deleteVehicle(\'',$car->vehicleId,'\',\'',$car->vin,'\')"><div class="tools tool_left"><i class="Hui-iconfont">&#xe609;</i>删除</div></a>
                    <div class="tools tool_left tool_btn"><i class="Hui-iconfont"></i>操作
                        <div class="tool_box">
                            <ul>';
                            if($car->arriveStatus==0)
                                echo '<a href="#" onClick="arriveRecAdd(\'',$car->vehicleId,'\');"><li id="tool1">到单<i class="Hui-iconfont not_adopt">&#xe6dd;</i></li></a>';
                            else
                                echo'<a href="#" onClick="arriveRecEdit(\'',$car->vehicleId,'\');"><li id="tool1">到单<i class="Hui-iconfont adopt">&#xe6e1;</i></li></a>';
                            if($car->taxStatus==0)
                                echo '<a href="#" onClick="taxAdd(\'',$car->vehicleId,'\');"><li id="tool2">垫税<i class="Hui-iconfont not_adopt">&#xe6dd;</i></li></a>';
                            else
                                echo'<a href="#" onClick="taxEdit(\'',$car->vehicleId,'\');"><li id="tool2">垫税<i class="Hui-iconfont adopt">&#xe6e1;</i></li></a>';
                            if($car->bondStatus==0)
                                echo '<a href="#" onClick="bondAdd(\'',$car->vehicleId,'\');"><li id="tool3">保税<i class="Hui-iconfont not_adopt">&#xe6dd;</i></li></a>';
                            else
                                echo'<a href="#" onClick="bondEdit(\'',$car->vehicleId,'\');"><li id="tool3">保税<i class="Hui-iconfont adopt">&#xe6e1;</i></li></a>';
                            if($car->enterStatus==0)
                                echo '<a href="#" onClick="enterAdd(\'',$car->vehicleId,'\');"><li id="tool4">入库<i class="Hui-iconfont not_adopt">&#xe6dd;</i></li></a>';
                            else
                                echo'<a href="#" onClick="enterEdit(\'',$car->vehicleId,'\');"><li id="tool4">入库<i class="Hui-iconfont adopt">&#xe6e1;</i></li></a>';
                            if($car->releaseStatus==0){
                                echo '<a href="#" id="dialog-link" onClick="release(\'',$car->vehicleId,'\',1)"><li id="tool4">申请放行<i class="Hui-iconfont not_adopt">&#xe6dd;</i></li></a>
                                    <a href="#" id="dialog-link" onClick="release(\'',$car->vehicleId,'\',2)"><li id="tool4">批准放行<i class="Hui-iconfont not_adopt">&#xe6dd;</i></li></a>';
                             }else{
                                if($car->releaseStatus==1)
                                    echo '<a href="#" id="dialog-link" onClick="release(\'',$car->vehicleId,'\',1)"><li id="tool4">申请放行<i class="Hui-iconfont adopt">&#xe6e1;</i></li></a>
                                        <a href="#" id="dialog-link" onClick="release(\'',$car->vehicleId,'\',2)"><li id="tool4">批准放行<i class="Hui-iconfont not_adopt">&#xe6dd;</i></li></a>';
                                else
                                    echo '<a href="#" id="dialog-link" onClick="release(\'',$car->vehicleId,'\',1)"><li id="tool4">申请放行<i class="Hui-iconfont adopt">&#xe6e1;</i></li></a>
                                        <a href="#" id="dialog-link" onClick="release(\'',$car->vehicleId,'\',2)"><li id="tool4">批准放行<i class="Hui-iconfont adopt">&#xe6e1;</i></li></a>';
                            }
                            if($car->invoiceStatus==0)
                                echo '<a href="#" onClick="invoiceAdd(\'',$car->vehicleId,'\');"><li id="tool7">发票<i class="Hui-iconfont not_adopt">&#xe6dd;</i></li></a>';
                            else
                                echo'<a href="#" onClick="invoiceEdit(\'',$car->vehicleId,'\');"><li id="tool7">发票<i class="Hui-iconfont adopt">&#xe6e1;</i></li></a>';
                            echo '</ul></div></div></td></tr>';
                    }
                }else{
                    echo '<tr><td colspan="10">',isset($noAuth)?$noAuth:"",'没有查询到任何车辆信息</td></tr>';
                }
            ?>
            
        </table>
    </div>
     <div class="pager" id="kkpager" data-total="<?php 
        if (empty($carList->list))
        {
            echo 1;
        }
        else 
        {
            echo $carList->page; 
        }
        ?>"></div>
<?php importFooter();?>